<!DOCTYPE html>
<html>
<head>
    <#assign dicSelect=JspTaglibs["http://www.casic304.cn/dicSelect"] />
    <#assign secSelect=JspTaglibs["http://www.casic304.cn/secSelect"] />
    <#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
    <meta charset="utf-8">
    <title>质量评审管理基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <style>
        .fillBtn{
            background:rgba(38,130,255,1) !important;s
        }
      .aa{
        padding-bottom: 60px;
      }
    </style>
</head>
<body class="listBody qbdms-particulars">
<#if flag !="1"&&flowStatus!='0'>
<div id="button" style="padding: 20px">
    <a class="layui-btn layui-btn-sm fillBtn" lay-event="" id="detail">
        <i class="iconfont iconicon_file"></i>
        <span>运行明细</span>
    </a>
    <a class="layui-btn layui-btn-sm flowChart fillBtn" lay-event="flowChart">
        <i class="layui-icon layui-icon-picture-fine"></i>
        <span >流程图</span>
    </a>
    <a class="layui-btn layui-btn-sm fillBtn" lay-event="" id="taskOpinion">
        <i class="iconfont iconicon_compile"></i>
        <span>审批历史</span>
    </a>
</div>
</#if>

<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body qbdms-add-view-body">
        <div class="qbdms-formTitle">质量评审管理 <#if flag !="1"><i class="qbdms-returnOn closeWindow">返回</i></#if></div>
    <form class="layui-form formPreview aa" requrl="${ctx}/qbdms/wQbdQualityReview/get" lay-filter="wQbdQualityReviewDataForm" >
        <div class="" style="width: 100%;">
            <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr id="tbxx"></tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">密级<span style="color: red;">*</span></td>
                    <td ><@secSelect.sec_select data_src=1 required=true name="secret"/></td>
                    <td class="qbdms-zeroTable-lable">型号<span style="color: red;">*</span></td>
                    <td name="model"></td>
                    <td class="qbdms-zeroTable-lable">专业<span style="color: red;">*</span></td>
                    <td name="major"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">评审时间<span style="color: red;">*</span></td>
                    <td name="reviewdate"></td>
                    <td class="qbdms-zeroTable-lable">评审项目名称<span style="color: red;">*</span></td>
                    <td name="reviewprojectname"></td>
                    <td class="qbdms-zeroTable-lable">责任单位<span style="color: red;">*</span></td>
                    <td name="dutydept"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">评审级别<span style="color: red;">*</span></td>
                    <td name="reviewlevel"></td>
                    <td class="qbdms-zeroTable-lable">评审地点</td>
                    <td name="reviewplace"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">评审结论<span style="color: red;">*</span></td>
                    <td name="reviewresult"></td>
                    <td class="qbdms-zeroTable-lable">评审类别<span style="color: red;">*</span></td>
                    <td name="reviewcategory"></td>
                    <td class="qbdms-zeroTable-lable">是否存在问题<span style="color: red;">*</span></td>
                    <td name="hasproblem"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">评审证明文件</td>
                    <td colspan="5">
                        <div class="uploadFileList" fileUploadName="supportdoc"></div>
                    </td>
                </tr>
                <#if flag =="1">
                <tr>
                  <td class="qbdms-zeroTable-lable">责任单位型号主管领导审批</td>
                  <td colspan="5">
                    <#list taskOpinionNewList as taskOpinionNewList>
                    <#if taskOpinionNewList.taskName == "责任单位1型号主管领导审批">
                    <p>${taskOpinionNewList.opinion}</p><br/>
                    <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                      日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                  </#if>
                </#list>
                      <#list taskOpinionNewList as taskOpinionNewList>
                      <#if taskOpinionNewList.taskName == "责任单位2型号主管领导审批">
                      <p>${taskOpinionNewList.opinion}</p><br/>
                      <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                        日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                    </#if>
                </#list>
                      <#list taskOpinionNewList as taskOpinionNewList>
                      <#if taskOpinionNewList.taskName == "责任单位3型号主管领导审批">
                      <p>${taskOpinionNewList.opinion}</p><br/>
                      <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                        日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                    </#if>
                </#list>
                  <#list taskOpinionNewList as taskOpinionNewList>
                  <#if taskOpinionNewList.taskName == "责任单位4型号主管领导审批">
                  <p>${taskOpinionNewList.opinion}</p><br/>
                  <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                    日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                </#if>
                </#list>
                <#list taskOpinionNewList as taskOpinionNewList>
                <#if taskOpinionNewList.taskName == "责任单位5型号主管领导审批">
                <p>${taskOpinionNewList.opinion}</p><br/>
                <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                  日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                </#if>
                </#list>
                <#list taskOpinionNewList as taskOpinionNewList>
                <#if taskOpinionNewList.taskName == "责任单位6型号主管领导审批">
                <p>${taskOpinionNewList.opinion}</p><br/>
                <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                  日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                </#if>
                </#list>
                <#list taskOpinionNewList as taskOpinionNewList>
                <#if taskOpinionNewList.taskName == "责任单位7型号主管领导审批">
                <p>${taskOpinionNewList.opinion}</p><br/>
                <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                  日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                </#if>
                </#list>
                <#list taskOpinionNewList as taskOpinionNewList>
                <#if taskOpinionNewList.taskName == "责任单位8型号主管领导审批">
                <p>${taskOpinionNewList.opinion}</p><br/>
                <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                  日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                </#if>
                </#list>
                <#list taskOpinionNewList as taskOpinionNewList>
                <#if taskOpinionNewList.taskName == "责任单位9型号主管领导审批">
                <p>${taskOpinionNewList.opinion}</p><br/>
                <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                  日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                </#if>
                </#list>
                <#list taskOpinionNewList as taskOpinionNewList>
                <#if taskOpinionNewList.taskName == "责任单位10型号主管领导审批">
                <p>${taskOpinionNewList.opinion}</p><br/>
                <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                  日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                </#if>
                </#list>
                </td>
                </tr>
                <tr>
                  <td class="qbdms-zeroTable-lable">相关单位会签</td>
                  <td colspan="5">
                    <#list taskOpinionNewList as taskOpinionNewList>
                    <#if taskOpinionNewList.taskName == "相关单位会签">
                    <p>${taskOpinionNewList.opinion}</p><br/>
                    <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                      日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                  </#if>
                </#list>
                </td>
                </tr>
                <tr>
                  <td class="qbdms-zeroTable-lable">型号主管副总师批准</td>
                  <td colspan="5">
                    <#list taskOpinionNewList as taskOpinionNewList>
                    <#if taskOpinionNewList.taskName == "型号主管副总师批准1">
                    <p>${taskOpinionNewList.opinion}</p><br/>
                    <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                      日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                  </#if>
                </#list>
                    <#list taskOpinionNewList as taskOpinionNewList>
                    <#if taskOpinionNewList.taskName == "型号主管副总师批准2">
                    <p>${taskOpinionNewList.opinion}</p><br/>
                    <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                      日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                    </#if>
                </#list>
                </td>
                </tr>
                <tr>
                  <td class="qbdms-zeroTable-lable">型号主管公司领导审批</td>
                  <td colspan="5">
                    <#list taskOpinionNewList as taskOpinionNewList>
                    <#if taskOpinionNewList.taskName == "型号主管公司领导审批">
                    <p>${taskOpinionNewList.opinion}</p><br/>
                    <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                      日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                  </#if>
                </#list>
                </td>
                </tr>
                <tr>
                  <td class="qbdms-zeroTable-lable">型号助理员确认</td>
                  <td colspan="5">
                    <#list taskOpinionNewList as taskOpinionNewList>
                    <#if taskOpinionNewList.taskName == "型号助理员确认">
                    <p>${taskOpinionNewList.opinion}</p><br/>
                    <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                      日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                  </#if>
                </#list>
                </td>
                </tr>
                </#if>
                </tbody>
            </table>
            <p class="qbdms-SubTableTitle"><span>质量评审信息子表</span><i class="qbdms-fileUpText"></i></p>
            <div class="qbdms-tableDiv">
                <a modetype="2" class="addFormTr1"
                   id="add" style="display: none"><i class="layui-icon layui-icon-addition" style="display: none"></i>新增</a>
                <table class="qbdms-temTable wQbdQualityRevSuList subFormTable"
                       id="wQbdQualityRevSuList" style="min-width: 1360px;">
                    <tbody>
                    <tr class="temSpace qbdms-temTable-thead">
                        <td class="temSpace" style="width: 5%;">
                            序号
                        </td>
                        <td class="temSpace subDialogShowState" style="width: 7%;">
                            评审问题描述
                        </td>
                        <td class="temSpace subDialogShowState" style="width: 7%;">
                            计划完成时间
                        </td>
                        <td class="temSpace subDialogShowState" style="width: 10%;">
                            责任人
                        </td>
                        <td class="temSpace subDialogShowState " style="width: 10%;">
                            解决措施<span style="color: red;">*</span>
                        </td>
                        <td class="temSpace subDialogShowState" style="width: 10%;">
                            完成情况<span style="color: red;">*</span>
                        </td>
                    </tr>
                    <tr class="temSpace subContTem">
                        <td class="temSpace qbdms-temTable-seNumber">
                            <div class="temTag">0</div>
                        </td>
                        <td class="temSpace qbdms-temTable-td" name="s:wQbdQualityRevSuList:reviewproblem"></td>
                        <td class="temSpace qbdms-temTable-td" name="s:wQbdQualityRevSuList:planfinshtime"></td>
                        <td class="temSpace qbdms-temTable-td " name="s:wQbdQualityRevSuList:persionuser"></td>
                        <td class="temSpace qbdms-temTable-td " name="s:wQbdQualityRevSuList:solutions"></td>
                        <td class="temSpace qbdms-temTable-td " name="s:wQbdQualityRevSuList:completionstatus"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <input name="reviewdate" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
            <input name="finishtime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
            <input name="createTime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
            <input name="updateTime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
        </div>
        <#if isClose != 'true' && flag !="1">
        <div class="layui-form-item btnformItem">
            <p>
                <button type="reset" id="closeWindow" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">返回</button>
            </p>
        </div>
        </#if>
    </form>
</div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'setter', 'layer', 'propsHandle', 'upload', 'common', 'laydate', 'jquery', 'publicMethods', 'qbdmsForm'], function () {
        // -----常量声明----------
        var $ = layui.jquery,
            laydate = layui.laydate,
            setter = layui.setter,  // 配置信息
            layer = layui.layer,
            common = layui.common,
            propsHandle = layui.propsHandle,
            upload = layui.upload,
            publicMethods = layui.publicMethods,
            formId = '' || '',
            form = layui.qbdmsForm;
        $(".subContTem").hide()

        var defProps = {
            //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
            viewMould: 'moulds/', // 组件模块 存放文件 *****
            selectorBtn: '.selectorBtn'
        };
        var temQuery = new propsHandle();  // 实例化模板功能部分
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });

        var dateTimeFiledLen = $(".dateTimeFiled");
        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
            });
        }
        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href ='${ctx}/qbdms/wQbdQualityReview/view/list';
        });
        // 子表初始化事件
        var count = 1;
        $(document).on('click', '.addFormTr1', function () {
            count += 1;
            var modetype = $(this).attr('modetype'),
                copyObj = $(this).parent().children('.subFormTable'),
                copyHtm = copyObj.find('tr').eq(1);
            if (modetype === '2') {
                //在这里做一个转换，控制子表隐藏行的必填
                var copyHtmlStr = copyHtm.html();
                copyHtmlStr = copyHtmlStr.replace(/requiredflag/g, "lay-verify");
                // 表格
                copyObj.append('<tr class="temSpace">' + copyHtmlStr + '</tr>');
                var trArr = copyObj.find('tr');
                trArr.eq(trArr.length - 1).find('td').eq(0).find('.temTag').html(trArr.length - 2);

                trArr.eq(trArr.length - 1).find('[isinit="1"]').each(function (i, item) {
                    $(item).attr('isinit', '2');
                });
                if (trArr.length > 3) {
                    trArr.eq(trArr.length - 1).find('[type=radio]').each(function (i, item) {
                        $(item).attr('name', (trArr.eq(1).find('[type=radio]').eq(i).attr('name')) + '_' + (trArr.length - 2))
                    });
                }
                temQuery.initTemEvent(defProps, serverPath, setter);
            } else if (modetype === '1') {
                // updateTr(copyObj, copyHtm);
            }
            form.render();
            lay('.datetime').each(function () {
                laydate.render({
                    elem: this
                    , type: 'year'
                    , trigger: 'click'
                });
            });
            $(".datetime").removeAttr("lay-key");
            publicMethods.bottomFixd()
        });
        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        var common = layui.common;
        common.updateForm({
            name: 'wQbdQualityReviewDataForm',
            idValue: "${id}",
            primary: "id",
            getCallback: function (data) {
                $("#tbxx").html("<td class='qbdms-zeroTable-lable'>填报信息:</td><td colspan='5' class=''>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</td>");

                $("input[name='dutyperson']").attr("ids", data.data.dutypersonid);

                //-修改页面 初始化附件组件 开始 ------------------------------------------
                $('.uploadFileList').each(function () {
                    var fileUploadName = $(this).attr("fileUploadName");
                    var jsonFile = data.data[fileUploadName];
                    var files = eval(jsonFile);

                    if (files) {
                        for (var i = 0; i < files.length; i++) {
                            var fileLevel = files[i].fileLevel;
                            var fileLevelText = files[i].fileLevelText;
                            var fileSec = '<div class="fileSecLevel fileSecXg layui-input-inline">' + '<@secSelect.sec_select data_src=1 hasBlank=false/>' + "</div>";
                            var newStr = '<span class="file-id" style="margin-right: 20px;" fileId=' + files[i].fileId + ' fileLevelText="' + fileLevelText + '">' + fileSec + '<span class="file-name" title="点击下载文件" onclick="downFile(this)"><i class="iconfont" style="margin-right: 5px"></i>' + files[i].fileName + '</span></span>';
                            $(this).html(newStr);
                            $(this).find("select:last").val(fileLevel);
                            $(this).find("select:last").attr("disabled", "disabled");
                        }
                    } else {
                        $(this).html("<span style='color: #c0c4cc'>未上传</span>");
                    }
                });
                //-修改页面 初始化附件组件 结束 ------------------------------------------
                //-修改页面 初始化子表 开始 ------------------------------------------
                $('table.subFormTable').each(function () {
                    var table = {
                        tableName: $(this).attr('class').split(" ")[1],
                        fields: []
                    };
                    table.fields = data.data[table.tableName];
                    if(table.fields.length==0){
                        $(this).parent(".qbdms-tableDiv").append("<p>无数据</p>")
                    }else {
                        $(this).parent(".qbdms-tableDiv").css('padding',"0px")
                    }
                    for (var i = 0, len = table.fields.length; i < len; i++) {
                        var dataRow = table.fields[i];
                        var temp = $("." + table.tableName).prev().click();
                        //这里有子表表头占一行，子表隐藏行占一行，所以取需要赋值的行时，需要temp=i+2
                        var domRow = $(this).find("tr.temSpace:eq(" + (i * 1 + 2) + ")");
                        $.each(dataRow, function (j, val) {
                            var domItem = domRow.find("[name$='" + j + "']");
                            if (domItem) {
                                domItem.html(val);
                            }
                        });
                    }
                });
            }
        });
        //下载附件
        window.downFile = function (obj) {
            var fileId = $(obj).parents("span").attr("fileId");
            window.location.href = serverPath.qbdmsPath + setter.extendLinkPath + "attachFile/download?fileId=" + fileId;
        }
        publicMethods.bottomFixd()
        $("body *").not("#closeWindow").attr("disabled", "disabled");
        $(".uploadFileCont .qbdms-fileUp,.uploadFileCont i,.addFormTr1").hide();
        $(".uploadFileCont").each(function () {
            if ($(this).children('.uploadFileList').children().length == 0) {
                $(this).children('.uploadFileList').append("<span style='color: #C0C4CC'>未上传</span>")
            }
        })
        var flag="${flag}";
        var procInstId = "${processRun.procInstId}";
        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        //运行明细
        $("#detail").click(function () {
            layer.open({
                type: 2,
                title: "运行明细",
                area: ['80%', '80%'],
                btn: ['关闭'],
                skin: 'btn-close',
                btnAlign: 'c',
                content: serverPath.qbdmsPath +'/workflow/processRun/view/detail?runId=' + runId
            });
        });

        //审批历史
        $("#taskOpinion").click(function () {
            parent.layer.open({
                type: 2,
                title: "审批历史",
                area: ['950px', '585px'],
                content: serverPath.qbdmsPath +"/workflow/taskOpinion/view/list?runId=" + runId
            })
        });

        //流程图
        $(".flowChart").click(function () {
            parent.layer.open({
                type: 2,
                title: "流程图",
                shade: 0.3,
                left: 200,
                area: ['1000px', '600px'],
                content: serverPath.qbdmsPath +"/workflow/processRun/view/bpmImg?procInstId="+procInstId+"&runId="+runId,
                btn:['','关闭'],
                success:function (layero,index) {
                    $(layero).find("a.layui-layer-btn0").hide();
                }
            });
        });

    });
</script>
</body>
</html>